package thread.noticywait;

public class ThreadWait implements Runnable{
	private CommonEntity obj;
	public ThreadWait(CommonEntity obj){
		this.obj=obj;
	}
	public CommonEntity getObj() {
		return obj;
	}
	public void setObj(CommonEntity obj) {
		this.obj = obj;
	}
	@Override
	public void run() {
		synchronized (obj) {
			try {
				System.out.println("wait before");
				obj.wait();
				System.out.println("wait after");
				System.out.println(obj.getI());
			} catch (InterruptedException e) {
				
				e.printStackTrace();
			}
		}
		
	}
}
